package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.R.R;
import net.wanho.service.StatisticsService;
import net.wanho.vo.BuyDailyVO;
import net.wanho.vo.BuyListTypeVO;
import net.wanho.vo.InOutMonthVO;
import net.wanho.vo.LiveDataVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 这个类是：
 *
 * @author: MENG HU WANG
 * @date: 2025/2/7 14:16
 * @version: 1.0
 */

@RestController
@RequiredArgsConstructor
@RequestMapping("statistics")
public class StatisticsController {
    private final StatisticsService statisticsService;

    // 在库库存信息
    @GetMapping("store-invent")
    public R storeInvent() {
        return R.ok(statisticsService.storeInvent());
    }


    //  每日采购量趋势
    @GetMapping("/buyListDaily")
    public R getBuyListDaily() {
        BuyDailyVO dailyData = statisticsService.getBuyListDaily();
        return R.ok(dailyData);
    }

    // 2024年出入库信息
    @GetMapping("/inOutMonth")
    public R getInOutMonth() {
        List<InOutMonthVO> monthData = statisticsService.getInOutMonth();
        return R.ok(monthData);
    }

    // 采购量占比
    @GetMapping("/buyListType")
    public R getBuyListType() {
        BuyListTypeVO typeData = statisticsService.getBuyListType();
        return R.ok(typeData);
    }

    // 今日实时数据监测
    @GetMapping("/live")
    public R getLiveData() {
        LiveDataVO liveData = statisticsService.getLiveData();
        return R.ok(liveData);
    }
}
